package binaryTree;

import utils.binaryTreeUtil.TreeNode;

public class maxDepth {
    public int maxDepth(TreeNode root) {
        return getDepth(root);
    }
    public int getDepth(TreeNode root){
        if (root==null) {
            return 0;
        }
        int left = getDepth(root.left);
        int right = getDepth(root.right);
        return Math.max(left, right)+1;
    }
    public static void main(String[] args) {
        
    }
}
